<?php

if ( ! defined("IN_OP") )
{
    exit("You can't access this file directly...");
}
include_once( "class/function_3d.php" );
$tabs_menu_list = "";
$tab_container_list = "";
$pos_other = posToMenu("登出" , "?op=core&fp=logout" , "_top" , "logo");
if ( $g_init_mode_6h )
{
    //$tabs_menu_list .= "<li  class=\"cur\"><a href=\"#tab0\" onclick=\"return false\">六合彩</a></li>";
    $tabs_menu_list .= '<div style="width: 60px; float: left;"><a class="btn btn-danger taba" style="padding-left: 10px;margin-left: 5px;margin-top: 21px;" href="#tab0">六合彩</a></div>';

//    $tab_0 = [];
    $tab_container_list .= "<div id=\"tab0\" style=\"max-width: 640px; float: left;\">";
//    $tab_container_list .= "<div class=\"menuLv02\" style=\"padding: 0 5px;\">";
    if ( $curruser['enabled'] != 2 )
    {
        //array_push($tab_0, posToMenu("本期注单" , "?op=member&fp=status" , "mainFrame" , "stat"));
        $tab_container_list .= posToMenu("本期注单" , "?op=member&fp=status" , "mainFrame" , "stat");
    }
    $tab_container_list .= posToMenu("帐户历史" , "?op=member&fp=history" , "mainFrame" , "hist")
        .posToMenu("会员资料" , "?op=member&fp=info" , "mainFrame" , "info")
        .posToMenu("开奖结果" , "?op=member&fp=result" , "mainFrame" , "resu")
        .posToMenu("规则说明" , "?op=member&fp=rule" , "mainFrame" , "rule")
        .posToMenu("官网开奖对照" , "?op=core&fp=lotto_open" , "mainFrame" , "lotto_open")
        .posToMenu("公告" , "?op=member_3d&fp=memnew" , "mainFrame" , "memn");
//        .posToMenu("公告" , "?op=member_3d&fp=memnew" , "mainFrame" , "memn").$pos_other."</div>";


    if ( $curruser['enabled'] == 2 )
    {
        $tab_container_list .= "<div> - 暂停下注 - </div>";
    }
    else
    {
//        include_once( "class_6h/class.menu.php" );
//        $betMenu = new menu_6h(31);
//        $tab_container_list .= "<div class=\"menuLv03\">";
//        $tab_container_list .= $betMenu->getMenu();
//        $tab_container_list .= "</div>";
    }
    $tab_container_list .= "</div>";


}


if ( $g_init_mode_3d )
{
    include_once( "class_3d/RateConfig_3d.php" );
    $RateConfig_3d = new RateConfig_3d(1);
    foreach ( $g_gametype_3d as $i => $val )
    {
        $tabs_menu_list .= $i && $g_menu_enabled[$i] == 1?$g_menu_list[$i]:"";
    }

   foreach ( $g_gametype_3d as $i => $val )
    {
        if ( ! $g_menu_enabled[$i] || ! $i )
        {
            continue;
        }
        $pgType = $g_gametype_3d[$i]['pg'];
        $tab_container_list .= "<div id=\"tab{$i}\" style=\"max-width: 640px; float: left;\">";
//        $tab_container_list .= "<div class=\"menuLv02\">";
        if ( $curruser['enabled'] != 2 )
        {
            $tab_container_list .= posToMenu("本期注单" , "?op=member{$pgType}&fp=status&gametype={$i}" , "mainFrame" , "stat");
        }
        $tab_container_list .= posToMenu("帐户历史" , "?op=member{$pgType}&fp=history&gametype={$i}" , "mainFrame" , "hist")
            .posToMenu("会员资料" , "?op=member{$pgType}&fp=info&gametype={$i}" , "mainFrame" , "info")
            .posToMenu("开奖结果" , "?op=member{$pgType}&fp=result&gametype={$i}" , "mainFrame" , "resu")
            .posToMenu("规则说明" , "?op=member_3d&fp=rule&gametype={$i}" , "mainFrame" , "rule")
            .posToMenu("官网开奖对照" , "?op=core&fp=lotto_open" , "mainFrame" , "lotto_open")
            .posToMenu("公告" , "?op=member_3d&fp=memnew&gametype={$i}" , "mainFrame" , "memn");
            //.posToMenu("公告" , "?op=member_3d&fp=memnew&gametype={$i}" , "mainFrame" , "memn").$pos_other."</div>";
        if ( $curruser['enabled'] == 2 )
        {
            $tab_container_list .= "<div> - 暂停下注 - </div>";
        }
        else
        {
           /* $show5N = getShow35($i);
            if ( $val['type'] == 3 )
            {
                include_once( "class_5h/RateConfig_5h.php" );
                $RateConfig_5h = new RateConfig_5h($i);
                $posToMenuArr = $RateConfig_5h->playtypeArr;
            }
            else
            {
                if ( $show5N )
                {
                    $RateConfig_3d->gametype = $i;
                    $RateConfig_3d->setPlaytypeArr_5n();
                }
                else
                {
                    $RateConfig_3d->gametype = $i;
                    $RateConfig_3d->setPlaytypeArr();
                }
                $posToMenuArr = $RateConfig_3d->playtypeArr;
            }
            $tab_container_list .= "<div class=\"menuLv03\">";
            foreach ( $posToMenuArr as $posToMenuArrKey => $posToMenuArrVal )
            {
                $posToMenuArrKeyTemp = $i == 20?"r1":$posToMenuArrKey;
                $tab_container_list .= posToMenu($posToMenuArrVal , "?op=member{$pgType}&fp=bet&palygroup={$posToMenuArrKey}&gametype={$i}" , "mainFrame" , $posToMenuArrKeyTemp);
            }
            $tab_container_list .= "</div>";*/
        }
        $tab_container_list .= "</div>";
    }

}


$header_js_code = " $('div.tab_content a[class!=meulogo]').click(function(){ ";
$header_js_code .= "  var gtp = $(this).parent('div').parent('div.tab_content').attr('id').substr(3);";
$header_js_code .= "  if(gtp==0){ window.top.leftFrame.location.replace('?op=member&fp=account&disk='+ disk); } ";
$header_js_code .= "  else if(gtp >= 20){ window.top.leftFrame.location.replace('?op=member_5h&fp=account&gametype='+gtp); } ";
$header_js_code .= "  else{ window.top.leftFrame.location.replace('?op=member_3d&fp=account&gametype='+gtp); } ";
$header_js_code .= " }); ";
$tmpArr = array ( );
foreach ( $g_gametype_3d as $gameid => $val )
{
    if ( $gameid == 0 )
    {
        $tmpArr[] = QuotedStr("op.php?op=member&fp=bet0");
    }
    else
    {
        $tmpArr[] = QuotedStr("op.php?op=member{$g_gametype_3d[$gameid]['pg']}&fp=bet&palygroup=r1&gametype={$gameid}");
    }
}
$linkArr = implode("," , $tmpArr);
$w=array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');

$ui->set(array (
    "time"=>time(),
    "nowday"=>date("m月d日"),
    "nowtime"=>date("H:i:s"),
    "noww"=>$w[date("w")],
    "header_js_code" => $header_js_code ,
    "disk" => $curruser['disk'] ,
    "tabs_menu_list" => $tabs_menu_list ,
    "tab_container_list" => $tab_container_list ,
    "linkArr" => $linkArr ,
    "andjs01" => "if(gtp==0){window.top.leftFrame.location.replace('?op=member&fp=account&disk='+ disk);}\r\n               else if(gtp >= 20){window.top.leftFrame.location.replace('?op=member_5h&fp=account&gametype='+gtp);}\r\n               else{window.top.leftFrame.location.replace('?op=member_3d&fp=account&gametype='+gtp);}" ,
    "andjs02" => "if(gtp==0 && linkArr[gtp]==null){linkArr[gtp]='op.php?op=member&fp=bet0'}else if( (gtp >= 20) &&linkArr[gtp]==null){linkArr[gtp]='op.php?op=member_5h&fp=bet&palygroup=r1&gametype=' + gtp}else if( linkArr[gtp]==null ){linkArr[gtp]='op.php?op=member_3d&fp=bet&palygroup=r1&gametype=' + gtp}" ,
    "myInfo" => "【hi,".$aclname[$curruser['acl']]." ".$curruser['name']."】 "
));
